package no5;

import java.util.*;

public class CircleArray {
	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		ArrayList<Circle> arr = new ArrayList();
		// insert 10 Circle
		for(int i = 0; i < 10; i++) {
			System.out.println("Please input the radias of this Circle");
			int r = in.nextInt();
			Circle temp = new Circle(r);
			arr.add(temp);
		}
		//iterator
		Iterator<Circle> it = arr.iterator();
		while(it.hasNext()) 
			System.out.println("圆形的面积为" + it.next().calculateArea());
		for(int i = 0; i < arr.size(); i++)
			System.out.println("圆形的面积为" + arr.get(i).calculateArea());
		in.close();
	}
}

class Circle {
	final double PI = 3.1415926;
	private double radias;
	
	public Circle() {}
	
	public Circle(double a) {
		this.radias = a;
	}
	
	public double getRadias() {
		return this.radias;
	}
	
	public void setRadias(double a) {
		this.radias = a;
	}
	
	public double calculateArea() {
		return PI * radias * radias;
	}
	
	public double calculatePerimeter() {
		return 2 * PI * radias;
	}
}

